package com.infindo.frame.util;

import java.io.IOException;
import java.io.InputStream;
import android.content.Context;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;

 

public class AssetsUtil {
 
	
    public static Drawable getPictureDrawable(Context context,String path, String name) {
    	
    	try {
			return new BitmapDrawable(context.getAssets().open(path + "/" + name+".jpg"));
		} catch (IOException e) {
//			System.out.println("ioexcetpion..."+e.getMessage());
			e.printStackTrace();
		}
		return null;
    }
    
    public static Drawable getAssetsPictureDrawable(Context context,String name) {
    	
    	try {
			return new BitmapDrawable(context.getAssets().open(name));
		} catch (IOException e) {
//			System.out.println("ioexcetpion..."+e.getMessage());
			e.printStackTrace();
		}
		return null;
    }
    
    public static InputStream getPictureStream(Context context, String assetsPath, String name) {
    	
    	try {
			return context.getAssets().open(assetsPath + name);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
    }
 
    public static InputStream getBigPictureStream(Context context, String name) {
    	
    	try {
			return context.getAssets().open( "/" + name);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
    }
     
    
 
    

    public static InputStream getLocalFileStream(Context context, String name) {
    	
    	try {
    		return context.getAssets().open( "" + name);
    	} catch (IOException e) {
    		// TODO Auto-generated catch block
    		e.printStackTrace();
    	}
    	return null;
    }
  
 
  
    
 
    
}
